home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 3
/
Precision Software Applications Silver Collection Volume Three (PSM) (1993).iso
/
music2
/
mepody.exe
/
PLAY.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-04-13
|
1KB
|
49 lines
{ PLAY procedure by A.A.Efros.
This pascal procedure is for work with Melody Master Data files.
In Turbo Pascal one has to use Crt unit. (uses Crt;)
Crt unit is for functions: Sound, Delay and NoSound.
To call procedure Play one should:
Play( [FileName], [MelodyName]);
For example:
Play('music.dat','Glory');
}
procedure Play (FileName, MelodyName : string);
var
q : integer;
ch : char;
st : string;
Data : text;
begin
assign(Data,FileName);
reset(Data);
st := '';
while not EOF(Data) do
begin
st := '';
repeat
read(Data,ch);
st := st + ch;
until ch = ' ';
if (st = MelodyName + ' ')
then
begin
while not Eoln(Data) do
begin
read(Data,q);
Sound(q);
read(Data,q);
Delay(q);
NoSound;
end;
Close(Data);
Exit;
end;
readln(Data);
end;
Close(Data);
Writeln(MelodyName,' Melody is not found!');
end;